<template>
    <div class="news-detail">
        <myheader :outerTitle='newDetail.title'></myheader>
      <div>
        <h1 class="news-title">{{newDetail.title}}</h1>
        <p class="news-info">
          <span>{{newDetail.add_time | changeTime}}</span>
          <span>{{newDetail.click}}人浏览过</span>
          <span>xxx分类</span>
        </p>
      </div>
      <div class="news-content" v-html="newDetail.content"></div>
      <div class="comment">
        <div class="submitbox">
          <h3></h3>
          <div>
            <mt-field></mt-field>
            <mt-button></mt-button>
          </div>
        </div>
        <div class="commentbox">
          <h3 class="line"></h3>
          <ul>
            <li>
              <h4 class="comment-content"></h4>
              <p><span class="comment-user"></span><span class="comment-time"></span></p>
            </li>
          </ul>
        </div>
        <div class="button-group">
          <mt-button></mt-button>
          <mt-button></mt-button>
        </div>
      </div>
    </div>
</template>
<script>
import { getNewsDetail } from '@/api'
import myheader from '@/components/myheader'
export default {
  components: {
    myheader
  },
  data () {
    return {
      newDetail: {}
    }
  },
  mounted () {
    console.log(this.$route.params.id)
    getNewsDetail(this.$route.params.id)
      .then((res) => {
        console.log(res)
        this.newDetail = res.message[0]
      })
  }
}
</script>
<style lang="scss" scoped>
.news-detail {
  padding: 40px 0 0 0;
  .news-title {
    font-size: 14px;
    font-weight: bold;
  }
  .news-info {
    font-size: 12px;
    color: #26a2ff;
    display: flex;
    justify-content: space-between;
  }
  .news-content {
    font-size: 12px;
  }
}
</style>
